#!/bin/bash
[[ -d $(date +%F) ]] || mkdir $(date +%F)
if [[ $1 == '' ]];then
        echo -e "\033[31m you need to provide a SQL file name\033[30m"
else
        mysql -uroot -pLLSuser@2022  --socket=/tmp/mysql_23306.sock --port=23306  < $1 >> $(date +%F)/data-$(date "+%F-%T").xlsx
fi

